import java.util.ArrayList;


public class TokenBoard {
	private ArrayList<Token> tokens;
	private ArrayList<Integer> rewarded;
	
	public TokenBoard(){
		tokens = new ArrayList<Token> ();
		rewarded = new ArrayList<Integer> ();
	}
	
	public void setToken(String token){
		if (tokens.size() > 4){
			System.out.println("Error 001 - Max. Tokens reached!");
			return;
		}
		else {
			tokens.add(new Token(token));
			rewarded.add(0);
		}
	}
	
	public void setToken(Token reward){
		if (tokens.size() > 4){
			System.out.println("Error 001 - Max. Tokens reached!");
			return;
		}
		else tokens.add(reward);
	}
	
	public void giveReward(int token){
		rewarded.set(token, rewarded.get(token)+1);
	}

	public int getNumToken(int token){
		return rewarded.get(token);
	}
	public int getTokenNum(){
		return tokens.size()*10; //10 being the maximum of tokens that can be awarded.
	}
	public String getRewardImage(int reinforcer){
		return tokens.get(reinforcer).getImage();
	}
	
	public int getNoOfTokens (){
		return tokens.size();
	}
	
	public void clearTokens (){
		tokens.clear();
	}
	
	public Token getToken (int index){
		return tokens.get(index);
	}
	public String getTokens(){
		String tokens = "";
		for (Token temp : this.tokens){
			tokens+=temp.getImage()+" ";
		}
		return tokens;	
	}
	public String getTokenName (int index){
		return tokens.get(index).getImage();
		
	}
}
